#include <iostream>
using namespace std;

long long n, x;

long long  arr[100001];

long long abor(long long a, long long b)
{
    long long c;
    while (a % b)
    {
        c = a % b;
        a = b;
        b = c;
    }
    return b;
}
int main() {
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        cin >> arr[i];
        if (x >= arr[i])
            x += arr[i];
        else
        {
            x += abor(x, arr[i]);
        }
    }
    cout << x;

}